extends Spatial
func _ready():
	Global.score=0
	$Score.text="score:"+str(Global.score)
	var control_connect=load("res://script/mobile_control.gd").new()
	control_connect.i_conect(get_node("Control"),$player)
	pass 
# warning-ignore:unused_argument
func _process(delta):
	$fps.text="fps:"+str(Engine.get_frames_per_second())
	pass
func show_fuhuo():
	var fuhuo=load("res://scene/fuhuo.tscn").instance()
	add_child(fuhuo)
#看广告复活
func died():
	show_fuhuo()
	print_debug("死了")
func _on_player_died(life):
	$life.text="life:"+str(life)
	pass # Replace with function body.
func _on_restart_pressed():
	print_debug("重新加载场景！")
# warning-ignore:return_value_discarded
	get_tree().reload_current_scene()
	pass # Replace with function body.


func _on_star_collided():
	$coin.play()
	Global.add_score()
	$Score.text="score"+str(Global.score)
	pass # Replace with function body.


func _on_player_open_chest():
	$open.play()
	$next_level.show()
	$wall.queue_free()
	$Sprite3D/Area/CollisionShape.disabled=false
	$Sprite3D.show()
	pass # Replace with function body.
func _on_reset_pressed():
# warning-ignore:return_value_discarded
	get_tree().reload_current_scene()
	pass # Replace with function body.
